<?php

class Application_Form_SoaItemAdd extends Zend_Form
{

	public function init()
	{
		
		$skuValidator = new Zend_Validate_Db_RecordExists(array('table' => 'tbl_inventoryItem', 'field' => 'inventoryItem'));

		
		$this->setMethod('post');
		
		$campaign_id = new Zend_Form_Element_Hidden('campaign_id');
		
		$processFlag = new Zend_Form_Element_Hidden('processedFlag');
		
		$sku = new Zend_Form_Element_Text('inventoryItem');
		$sku->setLabel('SKU');
		$sku->setAttrib('size', '7');
		$sku->setRequired(true);
		$sku->addValidator($skuValidator);
		
	
		$price = new Zend_Form_Element_Text('price');
		$price->setLabel('SOA Price per unit (&euro;)');
		$price->setAttrib('size', '7');
		$price->setRequired(true);
		
		$planQty = new Zend_Form_Element_Text('planQty');
		$planQty->setLabel('planned sellthrough (units)');
		$planQty->setAttrib('size', '10');
		$planQty->setRequired(true);
		
		$totalCost = new Zend_Form_Element_Text('totalCost');
		$totalCost->setLabel('Total planned cost (&euro;)');
		$totalCost->setAttrib('size', '15');
		$totalCost->setAttrib('readonly', 'readonly');

		$submit = new Zend_Form_Element_Submit('submit');
		$submit->setLabel('add item');

		$this->addElements(array($campaign_id, $processFlag, $sku, $price, $planQty, $totalCost, $submit));
	}


}

